<template>
  <div class="loading" v-show="msg.show">

    <transition name="fade">
        
      <div id="loader">
        <h3 class="loadingTitle">拼命加载中</h3>
        <div id="shadow"></div>
        <div id="box"></div>
      </div>
    </transition>
  </div>
</template>

<script>
export default {
  props: {
    msg: Object,
    aaa: Number,
  },
};
</script>

<style scoped lang="less">
.loading {
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.2);
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}
#loader {
  position: absolute;
  top: calc(50% - 20px);
  left: calc(50% - 20px);
  z-index: 999;
}

@keyframes loader {
  0% {
    left: -100px;
  }
  100% {
    left: 110%;
  }
}

#box {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 3px;
  width: 50px;
  height: 50px;
  background: #292929;
  animation: animate 0.5s linear infinite;
}
.loadingTitle{
    color: #292929;
    width: 300px;
    display: block;
    position: absolute;
  left: -20px;
  bottom: -85px;
}
@keyframes animate {
  17% {
    border-bottom-right-radius: 3px;
  }
  25% {
    transform: translateY(9px) rotate(22.5deg);
  }

  50% {
    border-bottom-right-radius: 40px;
    transform: translateY(18px) scale(1, 0.9) rotate(45deg);
  }
  75% {
    transform: translateY(9px) rotate(67.5deg);
  }
  100% {
    transform: translateY(0) rotate(90deg);
  }
}

#shadow {
  position: absolute;
  top: 59px;
  left: 0;
  border-radius: 50%;
  width: 50px;
  height: 5px;
  background: #000000;
  opacity: 0.1;
  animation: shadow 0.5s linear infinite;
}

@keyframes shadow {
  50% {
    transform: scale(1.2, 1);
  }
}
</style>
